class Solution {
public:
    bool checkAlmostEquivalent(string word1, string word2) {
        unordered_map<char,int> mp;
        for(char e : word1){
            mp[e]++;
        }
        for(char e : word2){
            mp[e]--;
        }
        for(unordered_map<char,int>::iterator it = mp.begin();it != mp.end();it++){
            if(it->second > 3 || it->second < -3) return false;
        }
        return true;
    }
};
